<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="example-1">
        <!-- v-on后跟:和事件，内容是行为，这里的行为相当于直接存在于vue.js中，能够影响到Vue实例中的数据 -->
        <button v-on:click="counter += 1">Add 1</button>
        <!-- 这里将Vue实例中的数据拿出来 -->
        <p>The button above has been clicked {{ counter }} times.</p>
      </div>

    <div id="example-2">
        <!-- `greet` 是在下面定义的方法名 -->
        <button v-on:click="greet">Greet</button>
    </div>

    <div id="example-3">
        <button v-on:click="say('hi')">Say hi</button>
        <button v-on:click="say('what')">Say what</button>
    </div>
      

    <div id="myExample-1">
        <button v-on:click="warn('Form cannot be submitted yet.', $event)">
            Submit
        </button>
    </div>
    <script src="vue.js"></script>
</body>
</html>